Fix run-rad-commands parse regression and add shell syntax gate for extension actions - #12775
Conversation
Co-authored-by: sk593 <42750942+sk593@users.noreply.github.com>
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
@copilot resolve conflicts |
There was a problem hiding this comment.
Pull request overview
Fixes a bash parse regression in the run-rad-commands extension composite action and adds a CI-enforced guard to prevent future unparseable run: | scripts in extension actions.
Changes:
- Restored the missing
}that closescleanup()in.github/extension/actions/run-rad-commands/action.ymlso the action’s bash script parses and runs. - Added
.github/extension/actions/action-shell-syntax_test.shto extract each extension actionrun: |block and validate it withbash -n. - Wired the new syntax gate into
make testviabuild/test.mkso it runs in CI.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.github/extension/actions/run-rad-commands/action.yml |
Fixes the unclosed cleanup() function to eliminate the immediate bash parse failure. |
.github/extension/actions/action-shell-syntax_test.sh |
Adds a regression test that syntax-checks extracted composite-action `run: |
build/test.mk |
Adds test-extension-action-shell-syntax and includes it in the aggregate test target. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…ommands-action # Conflicts: # build/test.mk Co-authored-by: sk593 <42750942+sk593@users.noreply.github.com>
Resolved in merge commit |
Radius functional test overviewClick here to see the test run details
Test Status⌛ Building Radius and pushing container images for functional tests... |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #12775 +/- ##
=======================================
Coverage 53.94% 53.95%
=======================================
Files 774 774
Lines 51991 51991
=======================================
+ Hits 28049 28054 +5
+ Misses 21315 21311 -4
+ Partials 2627 2626 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
….1 (#12831) Patch release `v0.60.1` for channel `0.60`. ## Backported PRs Listed in cherry-pick (topological) order. **Gap filler** = not requested for the patch, but included because it touched the same region of a shared file between `release/0.60` and a requested commit. Without it the cherry-pick has no common merge base and conflicts. | # | Commit | PR | Role | | --- | --- | --- | --- | | 1 | `6882b5fdf` | #12640 | Requested | | 2 | `af0443809` | #12721 | Requested | | 3 | `7c6de043d` | #12733 | **Gap filler** — `.github/workflows/codeql.yml` | | 4 | `ca7b5a3e7` | #12728 | Requested | | 5 | `2eac7c1f1` | #12702 | Requested | | 6 | `b4ebe2f28` | #12751 | Requested | | 7 | `e30a2594d` | #12727 | Requested | | 8 | `3c7dfecd6` | #12769 | **Gap filler** — `.github/workflows/codeql.yml` | | 9 | `787b6ca1a` | #12765 | **Gap filler** — `build/test.mk` | | 10 | `f84184955` | #12775 | Requested | | 11 | `415d5b9c2` | #12779 | Requested | | 12 | `a1d976013` | #12782 | Requested | | 13 | `14a21bd0d` | #12786 | **Gap filler** — `build/test.mk` | | 14 | `a87146c77` | #12764 | **Gap filler** — `build/test.mk` | | 15 | `073ca3cfa` | #12758 | Requested | | 16 | `5e1f94c13` | #12785 | **Gap filler** — `pkg/cli/cmd/install/kubernetes/kubernetes.go` | | 17 | `1fd650af5` | #12742 | Requested | | 18 | `19376c3f3` | #12829 | Requested | Five of the six gap fillers are CI/test-only. #12785 is not: it adds a Helm `control-plane-readiness` Job, a `pre-upgrade wait-for-control-plane` command, UCP readiness probes, and a NetworkPolicy change. It is required for #12829 to apply. ## Validation Full chain dry-run cherry-picked onto `release/0.60` with zero conflicts. `go build ./...` clean; `pkg/cli/cmd/install/kubernetes`, `cmd/pre-upgrade/cmd`, `pkg/cli/...`, `pkg/graph/...`, and `test/validation` all pass. --------- Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
…xtension actions (#12775) ## Summary `run-rad-commands` on `@main` was bricked by an unclosed `cleanup()` function in the composite action shell block, causing immediate `bash` parse failure before any `rad` command could run. This PR restores the missing brace and adds a CI guard that syntax-checks all extension action `run: |` blocks. - **Action runtime fix** - Close `cleanup()` before `trap cleanup EXIT` in `run-rad-commands/action.yml` so the script parses and executes. - **Regression prevention** - Add a shell test that extracts every `.github/extension/actions/**/action.yml` `run: |` block and validates each with `bash -n`. - **CI wiring** - Add `test-extension-action-shell-syntax` target and include it in the top-level `test` target. ```bash cleanup() { # ... write_result } trap cleanup EXIT ``` ## Reason for change A single missing `}` in the composite action shell block made the deploy path non-functional for workflows pinned to `@main`. YAML/action linting did not catch this class of failure; explicit shell parsing is required. ## How to test Run the focused shell regression checks: ```bash make test-run-rad-commands-action make test-extension-action-shell-syntax ``` ## File change summary | File | Summary of change | | ---- | ----------------- | | `.github/extension/actions/run-rad-commands/action.yml` | Restored the missing closing brace for `cleanup()` before `trap cleanup EXIT` in the `Run rad commands` shell block. | | `.github/extension/actions/action-shell-syntax_test.sh` | Added a new regression test that parses all extension action `run: |` blocks and runs `bash -n` on each extracted script body. | | `build/test.mk` | Added `test-extension-action-shell-syntax` target and wired it into the aggregate `test` target so CI enforces the syntax gate. | <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes #12773 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sk593 <42750942+sk593@users.noreply.github.com> (cherry picked from commit f841849) Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
….1 (#12831) Patch release `v0.60.1` for channel `0.60`. ## Backported PRs Listed in cherry-pick (topological) order. **Gap filler** = not requested for the patch, but included because it touched the same region of a shared file between `release/0.60` and a requested commit. Without it the cherry-pick has no common merge base and conflicts. | # | Commit | PR | Role | | --- | --- | --- | --- | | 1 | `6882b5fdf` | #12640 | Requested | | 2 | `af0443809` | #12721 | Requested | | 3 | `7c6de043d` | #12733 | **Gap filler** — `.github/workflows/codeql.yml` | | 4 | `ca7b5a3e7` | #12728 | Requested | | 5 | `2eac7c1f1` | #12702 | Requested | | 6 | `b4ebe2f28` | #12751 | Requested | | 7 | `e30a2594d` | #12727 | Requested | | 8 | `3c7dfecd6` | #12769 | **Gap filler** — `.github/workflows/codeql.yml` | | 9 | `787b6ca1a` | #12765 | **Gap filler** — `build/test.mk` | | 10 | `f84184955` | #12775 | Requested | | 11 | `415d5b9c2` | #12779 | Requested | | 12 | `a1d976013` | #12782 | Requested | | 13 | `14a21bd0d` | #12786 | **Gap filler** — `build/test.mk` | | 14 | `a87146c77` | #12764 | **Gap filler** — `build/test.mk` | | 15 | `073ca3cfa` | #12758 | Requested | | 16 | `5e1f94c13` | #12785 | **Gap filler** — `pkg/cli/cmd/install/kubernetes/kubernetes.go` | | 17 | `1fd650af5` | #12742 | Requested | | 18 | `19376c3f3` | #12829 | Requested | Five of the six gap fillers are CI/test-only. #12785 is not: it adds a Helm `control-plane-readiness` Job, a `pre-upgrade wait-for-control-plane` command, UCP readiness probes, and a NetworkPolicy change. It is required for #12829 to apply. ## Validation Full chain dry-run cherry-picked onto `release/0.60` with zero conflicts. `go build ./...` clean; `pkg/cli/cmd/install/kubernetes`, `cmd/pre-upgrade/cmd`, `pkg/cli/...`, `pkg/graph/...`, and `test/validation` all pass. --------- Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com> (cherry picked from commit e5938bf) Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
…xtension actions (#12775) ## Summary `run-rad-commands` on `@main` was bricked by an unclosed `cleanup()` function in the composite action shell block, causing immediate `bash` parse failure before any `rad` command could run. This PR restores the missing brace and adds a CI guard that syntax-checks all extension action `run: |` blocks. - **Action runtime fix** - Close `cleanup()` before `trap cleanup EXIT` in `run-rad-commands/action.yml` so the script parses and executes. - **Regression prevention** - Add a shell test that extracts every `.github/extension/actions/**/action.yml` `run: |` block and validates each with `bash -n`. - **CI wiring** - Add `test-extension-action-shell-syntax` target and include it in the top-level `test` target. ```bash cleanup() { # ... write_result } trap cleanup EXIT ``` ## Reason for change A single missing `}` in the composite action shell block made the deploy path non-functional for workflows pinned to `@main`. YAML/action linting did not catch this class of failure; explicit shell parsing is required. ## How to test Run the focused shell regression checks: ```bash make test-run-rad-commands-action make test-extension-action-shell-syntax ``` ## File change summary | File | Summary of change | | ---- | ----------------- | | `.github/extension/actions/run-rad-commands/action.yml` | Restored the missing closing brace for `cleanup()` before `trap cleanup EXIT` in the `Run rad commands` shell block. | | `.github/extension/actions/action-shell-syntax_test.sh` | Added a new regression test that parses all extension action `run: |` blocks and runs `bash -n` on each extracted script body. | | `build/test.mk` | Added `test-extension-action-shell-syntax` target and wired it into the aggregate `test` target so CI enforces the syntax gate. | <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes #12773 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sk593 <42750942+sk593@users.noreply.github.com> (cherry picked from commit f841849) Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
….1 (#12831) Patch release `v0.60.1` for channel `0.60`. ## Backported PRs Listed in cherry-pick (topological) order. **Gap filler** = not requested for the patch, but included because it touched the same region of a shared file between `release/0.60` and a requested commit. Without it the cherry-pick has no common merge base and conflicts. | # | Commit | PR | Role | | --- | --- | --- | --- | | 1 | `6882b5fdf` | #12640 | Requested | | 2 | `af0443809` | #12721 | Requested | | 3 | `7c6de043d` | #12733 | **Gap filler** — `.github/workflows/codeql.yml` | | 4 | `ca7b5a3e7` | #12728 | Requested | | 5 | `2eac7c1f1` | #12702 | Requested | | 6 | `b4ebe2f28` | #12751 | Requested | | 7 | `e30a2594d` | #12727 | Requested | | 8 | `3c7dfecd6` | #12769 | **Gap filler** — `.github/workflows/codeql.yml` | | 9 | `787b6ca1a` | #12765 | **Gap filler** — `build/test.mk` | | 10 | `f84184955` | #12775 | Requested | | 11 | `415d5b9c2` | #12779 | Requested | | 12 | `a1d976013` | #12782 | Requested | | 13 | `14a21bd0d` | #12786 | **Gap filler** — `build/test.mk` | | 14 | `a87146c77` | #12764 | **Gap filler** — `build/test.mk` | | 15 | `073ca3cfa` | #12758 | Requested | | 16 | `5e1f94c13` | #12785 | **Gap filler** — `pkg/cli/cmd/install/kubernetes/kubernetes.go` | | 17 | `1fd650af5` | #12742 | Requested | | 18 | `19376c3f3` | #12829 | Requested | Five of the six gap fillers are CI/test-only. #12785 is not: it adds a Helm `control-plane-readiness` Job, a `pre-upgrade wait-for-control-plane` command, UCP readiness probes, and a NetworkPolicy change. It is required for #12829 to apply. ## Validation Full chain dry-run cherry-picked onto `release/0.60` with zero conflicts. `go build ./...` clean; `pkg/cli/cmd/install/kubernetes`, `cmd/pre-upgrade/cmd`, `pkg/cli/...`, `pkg/graph/...`, and `test/validation` all pass. --------- Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com> (cherry picked from commit e5938bf) Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
Summary
run-rad-commandson@mainwas bricked by an unclosedcleanup()function in the composite action shell block, causing immediatebashparse failure before anyradcommand could run. This PR restores the missing brace and adds a CI guard that syntax-checks all extension actionrun: |blocks.cleanup()beforetrap cleanup EXITinrun-rad-commands/action.ymlso the script parses and executes..github/extension/actions/**/action.ymlrun: |block and validates each withbash -n.test-extension-action-shell-syntaxtarget and include it in the top-leveltesttarget.Reason for change
A single missing
}in the composite action shell block made the deploy path non-functional for workflows pinned to@main. YAML/action linting did not catch this class of failure; explicit shell parsing is required.How to test
Run the focused shell regression checks:
File change summary
.github/extension/actions/run-rad-commands/action.ymlcleanup()beforetrap cleanup EXITin theRun rad commandsshell block..github/extension/actions/action-shell-syntax_test.shbuild/test.mktest-extension-action-shell-syntaxtarget and wired it into the aggregatetesttarget so CI enforces the syntax gate.